<?php
/**
 * Template Name: Login
 */

get_header(); ?>

<div class="container">
    <h1><?php the_title() ?></h1>

    <div class="row-fluid">
        <div class="span12">
            <?php
            if (is_user_logged_in()) {
                ?>
                <div class="alert">
                    <strong>You Are Already Logged In as <a style="font-weight:900">
                        <?php global $current_user;
                        get_currentuserinfo();

                        echo $current_user->user_firstname;
                        ?>
                    </a></strong>
                </div>
                <a href="/enter.php?action=logout" class="btn btn-primary">Log out »</a>
                <?
            }
            ?>

        </div>
    </div>
</div>


<?php get_footer(); ?>

<script>
    $(function () {
        if (<?php
        if (is_user_logged_in()) {
            echo 'false';
        } else {
            echo 'true';
        }
        ?>) {
            $('#loginModal').modal({
                backdrop:'static '
            });
            $('#loginModal').on('hide', function () {
                return false;
            });
        }
    });
</script>